package com.buaa.hyf.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.SlidingDrawer;

public class MainActivity extends AppCompatActivity {

    private SlidingDrawer sliding;
    private ImageView handle;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        sliding = (SlidingDrawer) findViewById(R.id.sliding);
        handle= (ImageView) findViewById(R.id.handle_img);

        sliding.setOnDrawerOpenListener(new SlidingDrawer.OnDrawerOpenListener() {
            @Override
            public void onDrawerOpened() {
                handle.setImageResource(R.drawable.img2);
            }
        });

        sliding.setOnDrawerCloseListener(new SlidingDrawer.OnDrawerCloseListener() {
            @Override

            public void onDrawerClosed() {
                handle.setImageResource(R.drawable.img1);
            }
        });
    }
}
